﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WarehouseManagement.Infrstructre;

namespace WarehouseManagement.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class DatabaseController : ControllerBase
    {
        public SqlSugarDbContext db;


        public DatabaseController(SqlSugarDbContext db)
        {
            this.db = db;
        }

        [HttpGet]
        public string InitDataBase()
        {
            db.CreatDataBase();
            return "ok";
        }


        [HttpGet]
        [Route("Apollo")]
        public IActionResult ApolloIndex([FromServices] IConfiguration configuration,string key)
        {
            var elkConfig = configuration[key];
            return Ok(elkConfig);
        }


    }
}
